package com.cbb.springcloud.service;

import com.cbb.springcloud.common.entity.PaymentEntity;
import com.cbb.springcloud.dao.PaymentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 支付 service
 *
 * @author chaibb
 * @date 2021-07-12 19:38:33
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PaymentService {

    @Autowired
    private PaymentDao paymentDao;

    /**
     * 新增
     *
     * @author chaibb
     * @date 2021-07-12 19:52:32
     */
    public Integer insert(PaymentEntity payment) {
        return paymentDao.insert(payment);
    }

    /**
     * 根据 id 查看详情
     *
     * @author chaibb
     * @date 2021-07-12 19:53:18
     */
    public PaymentEntity getPaymentById(Long id) {
        return paymentDao.getPaymentById(id);
    }
}
